home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / flex_247.zip / flex_247 / MISC / VMS / VMS.alloca < prev    next >
Text File  |  1991-05-10  |  1KB  |  52 lines

  1. (Message inbox:144)
  2. Date:     Fri, 10 May 1991 16:08:06 EDT
  3. From:  YOUNG@TATTOO.CS.WIDENER.EDU
  4. Subject:  alloca.mar
  5. To:  vern@horse.ee.lbl.gov
  6. X-Vmsmail-To:  SMTP%"vern@horse.ee.lbl.gov"
  7.  
  8. > By the way, flex doesn't need alloca() (unless,
  9. > perhaps, if you build the parser using bison?), so I'll comment out that part
  10. > of the .com file.
  11.  
  12.  
  13. Vern,
  14.  
  15.        ALLOCA is not a function that VMS C supports (far as I can tell ) so
  16.        there is a kludge that GNU uses and I include here (for those that don't
  17.        have GNU source). What follows is the calls to ALLOCA in parse.c 
  18.        (created using Bison).  Again, VMS does not have a yacc so GNU bison
  19.        suffices.
  20.  
  21.       yyss = (short *) alloca (yymaxdepth * sizeof (*yyssp));
  22.       yyvs = (YYSTYPE *) alloca (yymaxdepth * sizeof (*yyvsp));
  23.       yyls = (YYLTYPE *) alloca (yymaxdepth * sizeof (*yylsp));
  24.  
  25.  Building FLEX on a VMS machine was not *that* hard.  The C source compiles
  26.  very good so it is just a matter of getting Bison actually ( a C compiler
  27.  would also help :).  I forgot about the alloca.mar fix-up . . . 
  28.  
  29.  
  30.             Rob.
  31.  
  32.  
  33.  
  34. --- cut here for alloca.mar ---
  35.  
  36.     .TITLE    ALLOCA    Allocate dynamic storage on stack/free on return
  37.     .IDENT    /1.00/
  38.  
  39.     .PSECT    $CODE,LONG,PIC,REL,SHR,EXE,RD,NOWRT
  40.     .ENTRY    ALLOCA,^M<>
  41.     SUBL2    4(AP),SP
  42.     MOVL    16(FP),R1
  43.     MOVQ    8(FP),AP
  44.     BICL2    #3,SP
  45.     ADDL2    #28,SP
  46.     MOVL    SP,R0
  47.     JMP     (R1)
  48.  
  49.     .END
  50.  
  51.  
  52.